package com.example.controller;

import com.example.pojo.Order;
import com.example.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yinyin
 * @create 2021/07/14 下午 4:58
 */
@RestController
@RequestMapping("order")
public class OrderController {

    @Autowired
    private OrderService orderService;

    @GetMapping("/{id}/getOne")
    public Order selectOne(@PathVariable("id") Integer id){
        return orderService.selectOne(id);
    }

    @GetMapping("/{id}/getAll")
    public Order getAll(@PathVariable("id") Integer id){
        return  orderService.queryOne(id);
    }

    @GetMapping("/{id}/getByIds")
    public Order getByIds(@PathVariable("id")Integer id){
        return  orderService.searchOne(id);
    }

}
